package com.supcon.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.supcon.util.DateUtil;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Past;
import javax.validation.constraints.Pattern;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author BeautifulHao
 * @description
 * @create 2019-04-25 14:47
 **/
@Data
@TableName("up_user")
public class User extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 昵称
     */
    @NotEmpty(message="姓名不能为空！")
    private String name;
    /**
     * 编号
     */
    @NotEmpty(message="编码不能为空！")
    @Length(max=20,min = 5,message="编码长度需在5~20位！")
    private String code;
    /**
     * 身份证编号
     */
    private String cardNo;
    /**
     * 邮箱
     */
    @Email
    private String email;
    /**
     * 手机
     */
    private String phone;
    /**
     * 生日
     */
    @Past
    private LocalDate birthday;
    /**
     * 性别
     */
    private Integer gender;
    /**
     * 备注
     */
    private String remark;

}
